/**
 * 根据父级ID 查询 字典数组
 * @param pcode
 * @returns {Int32Array | * | Uint32Array | T[] | Int8Array | Float64Array}
 */
export function dicListByPcode(pCode) {
  return JSON.parse(localStorage.getItem('_DICTIONARY')).filter(item => item.pcode === pCode);
}


/**
 * 根据编码和父级字典转换
 * @param code 编码
 * @param pcode 字典父级编码
 * @returns {Int32Array | * | Uint32Array | T[] | Int8Array | Float64Array}
 */
export function dicTextByCodePcode(code, pCode){

  let dicArr = dicListByPcode(pCode);
  return dicArr.find(item => item.code === code).name
}
